home *** CD-ROM | disk | FTP | other *** search
/ Explorers of the New World / Explorers of the New World.iso / pc / exdata.dir / 00836_PrintPictures.ls < prev    next >
Encoding:
Text File  |  1995-09-10  |  3.4 KB  |  122 lines

  1. on printitem
  2.   global pictureButton, mapButton, printButton, textButton, clickedTopic
  3.   activateButtonKeepActivated(the clickOn)
  4.   set badButtonsList to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
  5.   set badButtonsLocHList to []
  6.   set badButtonsLocHList to getSpriteListLocH(badButtonsList)
  7.   moveSpritesOffstage(badButtonsList)
  8.   set explorerFrameLabel to getMarkerFromExplorer(clickedTopic)
  9.   if the name of cast the castNum of sprite pictureButton = "Picture ACTIVATED" then
  10.     setTextField(clickedTopic)
  11.     set explorerPrintFrame to explorerFrameLabel && "PRT"
  12.     printFrame(explorerPrintFrame)
  13.   end if
  14.   if the name of cast the castNum of sprite textButton = "Text ACTIVATED" then
  15.     printText()
  16.   end if
  17.   if the name of cast the castNum of sprite mapButton = "Map ACTIVATED" then
  18.     setTextField(clickedTopic)
  19.     set explorerPrintFrame to explorerFrameLabel && "PRT"
  20.     printFrame(label(explorerPrintFrame) + 1)
  21.   end if
  22.   setSpriteListLocH(badButtonsList, badButtonsLocHList)
  23. end
  24.  
  25. on getMarkerFromExplorer explorer
  26.   global mapMarkers
  27.   set topicLine to 1
  28.   set the itemDelimiter to ":"
  29.   repeat with i = 1 to the number of lines in mapMarkers
  30.     if item 1 of line i of mapMarkers = explorer then
  31.       set marker to item 2 of line i of mapMarkers
  32.       set the itemDelimiter to ","
  33.       exit repeat
  34.     end if
  35.   end repeat
  36.   return marker
  37. end
  38.  
  39. on printFrame aPrintFrame
  40.   global hilitTopic
  41.   if stringp(aPrintFrame) then
  42.     set aPrintFrame to label(aPrintFrame)
  43.   end if
  44.   set oldStageColor to the stageColor
  45.   set the stageColor to 0
  46.   set saveHilitTopicPos to the locH of sprite hilitTopic
  47.   set the locH of sprite hilitTopic to 3000
  48.   printFrom(aPrintFrame, aPrintFrame)
  49.   set the locH of sprite hilitTopic to saveHilitTopicPos
  50.   set the stageColor to oldStageColor
  51. end
  52.  
  53. on setTextField anExplorer
  54.   put " " into field "ExplorerName"
  55.   set the textFont of field "ExplorerName" to "Palatino"
  56.   set the textSize of field "ExplorerName" to 18
  57.   set the textAlign of field "ExplorerName" to "left"
  58.   put anExplorer into field "ExplorerName"
  59. end
  60.  
  61. on setPuppets Alist, state
  62.   repeat with i = 1 to count(Alist)
  63.     puppetSprite(getAt(Alist, i), state)
  64.   end repeat
  65. end
  66.  
  67. on getPuppetList
  68.   set puppetList to []
  69.   repeat with i = 1 to 48
  70.     if the puppet of sprite i then
  71.       append(puppetList, i)
  72.     end if
  73.   end repeat
  74.   return puppetList
  75. end
  76.  
  77. on hideNonPrintingSprites
  78.   if not (the machineType = 256) then
  79.     exit
  80.   end if
  81.   repeat with s = 1 to 25
  82.     set the visible of sprite s to 0
  83.   end repeat
  84.   repeat with s = 32 to 47
  85.     set the visible of sprite s to 0
  86.   end repeat
  87. end
  88.  
  89. on unhideNonPrintingSprites
  90.   if not (the machineType = 256) then
  91.     exit
  92.   end if
  93.   repeat with s = 1 to 25
  94.     set the visible of sprite s to 1
  95.   end repeat
  96.   repeat with s = 32 to 47
  97.     set the visible of sprite s to 1
  98.   end repeat
  99. end
  100.  
  101. on getSpriteListLocH Alist
  102.   set LocHList to []
  103.   repeat with i = 1 to count(Alist)
  104.     set aSpriteLocH to the locH of sprite getAt(Alist, i)
  105.     append(LocHList, aSpriteLocH)
  106.   end repeat
  107.   return LocHList
  108. end
  109.  
  110. on moveSpritesOffstage Alist
  111.   repeat with i = 1 to count(Alist)
  112.     set the locH of sprite getAt(Alist, i) to 3000
  113.   end repeat
  114. end
  115.  
  116. on setSpriteListLocH Alist, aLocHList
  117.   repeat with i = 1 to count(Alist)
  118.     set oldLocH to getAt(aLocHList, i)
  119.     set the locH of sprite getAt(Alist, i) to oldLocH
  120.   end repeat
  121. end
  122.